/**
 * createby : lbj
 * date : 2018/8/6
 * desc :
 **/

package com.example.demo.common.entity;

import com.example.demo.common.enums.ProjectEnum;
import com.example.demo.common.enums.ResultEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {

    private int code;
    private String message;
    private Object data;

    public static Result buildResult(int code, String message, Object data) {

        return new Result(code, message, data);

    }

    public static Result buildResult(ProjectEnum resultEnum, Object data) {

        return new Result(resultEnum.getCode(), resultEnum.getMessage(), data);

    }


}
